package ee.ttu.rakarh.services;

import java.util.Collection;

import ee.ttu.rakarh.model.data.dao.ItemDAO;
import ee.ttu.rakarh.model.data.dao.ItemDAOImpl;
import ee.ttu.rakarh.model.data.dao.ItemTypeDAO;
import ee.ttu.rakarh.model.data.dao.ItemTypeDAOImpl;
import ee.ttu.rakarh.model.data.entities.Item;
import ee.ttu.rakarh.model.data.entities.ItemType;

public class ItemServiceImpl implements ItemService {

	@Override
	public Collection<Item> getItemsByTypeId(int typeId) {
		ItemDAO itemDAO = new ItemDAOImpl();
		ItemTypeDAO itemTypeDAO = new ItemTypeDAOImpl();
		ItemType type = itemTypeDAO.getItemTypeById(typeId);
		Collection<Item> items = itemDAO.getItemsByTypeId(type);
		return items;
	}

	
	
	

}
